
# -*- coding:utf-8 -*-
"""
已知1有以下的字符串，里面包含了54个手机号码，但这些号码中部分被污染了，其中包含了非数字字符，请将这些字符替换成空字符串，并将所有号码提取成了一个列表
''' 133 67663107, 14907936085, 1532 6287802, 17357050227, 17714328 898, 18085519624, 18178525609, 18976105830, 19068888125, 19124947754, 19342866203, 19901122493, 13001030066, 13110215911, 13224811099, 14544284723, 15557059579, 15654793680, 16675102173, 16759295141, 17199337709, 17557931772, 17669259024, 1856a6219552, 18601884728, 1963 1242226, 13422472144, 135p77772318, 13615818023, 13706435098, 13837933001, 13982176275, 14473131512, 14776264539, 14859418814, 15056812736, 15132178017, 15264848531, 15776358373, 15882476322, 15904d585125, 17262275765, 17815489245, 18294379230, 18363430217, 18426589465, 18727185556, 18807706027, 19508742824, 19754733494, 19881774254, 17026615234, 174485a58967 '''
"""


if __name__ == '__main__':
    dirty_telephone_str = ''' 133 67663107, 14907936085, 1532 6287802, 17357050227, 17714328 898, 18085519624, 18178525609, 18976105830, 19068888125, 19124947754, 19342866203, 19901122493, 13001030066, 13110215911, 13224811099, 14544284723, 15557059579, 15654793680, 16675102173, 16759295141, 17199337709, 17557931772, 17669259024, 1856a6219552, 18601884728, 1963 1242226, 13422472144, 135p77772318, 13615818023, 13706435098, 13837933001, 13982176275, 14473131512, 14776264539, 14859418814, 15056812736, 15132178017, 15264848531, 15776358373, 15882476322, 15904d585125, 17262275765, 17815489245, 18294379230, 18363430217, 18426589465, 18727185556, 18807706027, 19508742824, 19754733494, 19881774254, 17026615234, 174485a58967 '''

    dirty_telephone_list = dirty_telephone_str.split(',')
    print("共有多少个手机号码：", len(dirty_telephone_list))
    #print(dirty_telephone_list)

    normal_telephone_list =[]
    for telephone in dirty_telephone_list:
        normal_telephone = filter(str.isdigit, telephone)
        normal_telephone_list.append(''.join(list(normal_telephone)))
    print(list(normal_telephone_list))